package com.example.tass.domain;

import cn.tass.SRJ1933.devices.utis.StringUtils;
import cn.tass.exceptions.TAException;

public class MyRawSignExternalRequest extends MyBaseRequest{
    private String privKey;
    private String encKeyId;
    private String enckeyAccessCode;
    private Integer encMode;
    private Integer encPadMode;
    private String encIv;
    private String algorithm;
    private String data;
    private int dataType;
    private String sm2UserID;
    private String sm2PubKeyInfo;
    private Integer sm2PubKeyInfoType;
    private Integer rsaPadMode;
    private Integer signFormat;

    public MyRawSignExternalRequest() {
    }

    public String getPrivKey() {
        return this.privKey;
    }

    public void setPrivKey(String privKey) {
        this.privKey = privKey;
    }

    public String getEncKeyId() {
        return this.encKeyId;
    }

    public void setEncKeyId(String encKeyId) {
        this.encKeyId = encKeyId;
    }

    public String getEnckeyAccessCode() {
        return this.enckeyAccessCode;
    }

    public void setEnckeyAccessCode(String enckeyAccessCode) {
        this.enckeyAccessCode = enckeyAccessCode;
    }

    public Integer getEncMode() {
        return this.encMode;
    }

    public void setEncMode(Integer encMode) {
        this.encMode = encMode;
    }

    public Integer getEncPadMode() {
        return this.encPadMode;
    }

    public void setEncPadMode(Integer encPadMode) {
        this.encPadMode = encPadMode;
    }

    public String getEncIv() {
        return this.encIv;
    }

    public void setEncIv(String encIv) {
        this.encIv = encIv;
    }

    public String getAlgorithm() {
        return this.algorithm;
    }

    public void setAlgorithm(String algorithm) {
        this.algorithm = algorithm;
    }

    public String getData() {
        return this.data;
    }

    public void setData(String data) {
        this.data = data;
    }

    public int getDataType() {
        return this.dataType;
    }

    public void setDataType(int dataType) {
        this.dataType = dataType;
    }

    public String getSm2UserID() {
        return this.sm2UserID;
    }

    public void setSm2UserID(String sm2UserID) {
        this.sm2UserID = sm2UserID;
    }

    public String getSm2PubKeyInfo() {
        return this.sm2PubKeyInfo;
    }

    public void setSm2PubKeyInfo(String sm2PubKeyInfo) {
        this.sm2PubKeyInfo = sm2PubKeyInfo;
    }

    public Integer getSm2PubKeyInfoType() {
        return this.sm2PubKeyInfoType;
    }

    public void setSm2PubKeyInfoType(Integer sm2PubKeyInfoType) {
        this.sm2PubKeyInfoType = sm2PubKeyInfoType;
    }

    public Integer getRsaPadMode() {
        return this.rsaPadMode;
    }

    public void setRsaPadMode(Integer rsaPadMode) {
        this.rsaPadMode = rsaPadMode;
    }

    public Integer getSignFormat() {
        return this.signFormat;
    }

    public void setSignFormat(Integer signFormat) {
        this.signFormat = signFormat;
    }

    public void validate() throws TAException {
        this.checkParamIsEmpty(this.privKey, "privKey");
        this.checkParamIsEmpty(this.algorithm, "algorithm");
        this.checkParamIsEmpty(this.data, "data");
        if (!StringUtils.isEmpty(this.encKeyId) && this.encMode != 0 && StringUtils.isEmpty(this.encIv)) {
            throw new TAException("When the private key is encript text and not ECB mode, the encIv parameter must be set to.", new Object[]{""});
        }
    }
}
